package cn.fl.product.controller;

import cmm.mid.core.framework.page.DataResultVO;
import cn.cmm.base.framework.constant.BaseConstant;
import cn.cmm.base.framework.exception.BaseException;
import cn.cmm.base.framework.utils.CollectionUtils;
import cn.cmm.base.framework.utils.StringUtils;
import cn.fl.spl.service.ISplPropInfoService;
import cn.fl.spl.vo.SplPropInfoVO;
import fl.spl.facade.store.condition.SplPropInfoQueryCondition;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.List;

@Controller
@RequestMapping("spepow/bigcustomer")
public class SplBigCustomerController {

    @Autowired
    private ISplPropInfoService splPropInfoService ;

    public Object initList(HttpServletRequest request ,HttpServletResponse response) throws BaseException {
        DataResultVO result = new DataResultVO(BaseConstant.IS_YESNO_YES,"获取成功");
        String splId = request.getParameter("splId");
        if(StringUtils.isEmpty(splId)){
            result.setInfo("供应商ID为空");
            result.setSuccess(BaseConstant.IS_YESNO_NO);
            return result ;
        }
        SplPropInfoQueryCondition qc = new SplPropInfoQueryCondition();
        qc.setSplId(Long.valueOf(splId));
        qc.setIsValid(BaseConstant.IS_YESNO_YES);
        qc.setIsDel(BaseConstant.IS_YESNO_NO);
        qc.setPropTypCd("006");
        List<SplPropInfoVO> voList = this.splPropInfoService.searchList(qc);
        if(CollectionUtils.isNotEmpty(voList)){
            if(StringUtils.isNotEmpty(voList.get(0).getPropInfo()) && voList.get(0).getPropInfo().contains("8")){

            }
        }
        return result ;
    }
}
